<template>
	<view class="lookCache">
		<view class="status_bar">
			<!-- 这里是状态栏 -->
		</view>
		<view class="navTitle">
			
			<view class="titleText">
				<img class="goback" src="~/static/icon/back.png" @click="goBack">
				<text>我的缓存</text>
				<span>编辑</span>
			</view>
		</view>

		<view class="videoContent">
			<view class="contentAll">
				<view class="allBtn">
					<img src="~/static/icon/start.png">
					<span>全部开始</span>
				</view>
				<!-- <img src="~/static/icon/store.png"> -->
			</view>

			<view class="cacheVideo">
				<view class="contentList" v-for="(item,index) in videoList" :key="index">
					<view class="contentList-l">
						<img :src="item.vod_pic" mode="aspectFill">
						<view class="downloadSty">
							<img src="~/static/icon/download2.png" class="icon">
							<span>缓存中</span>
						</view>
					</view>
					<view class="contentList-r">
						<p>正在缓存</P>
						<view class="downloadInfo">
							<view class="videoTitle">
								<text>{{item.vod_name}}</text>
								<span>{{item.nid}}</span>
							</view>
							<view class="progressBar">
								<cmd-progress :percent="65" :stroke-width="2" stroke-color="#00A7FF" stroke-shape="square" :showInfo="false"></cmd-progress>
							</view>
							<view class="memory">
								<span>30.0MB/S</span>
								<span>260.88M/650M</span>
							</view>
						</view>
					</view>
				</view>
				
			</view>
		</view>
	</view>
</template>

<script>
	import cmdProgress from "@/components/cmd-progress/cmd-progress.vue"
	export default {
		components: {
			cmdProgress
		},
		data() {
			return {
				videoList: []
			}
		},
		onLoad() {
			let vi_code = uni.getStorageSync('user_info');
			// this.vodId = option.vodId
			uni.request({
				url: 'http://221.234.36.126:82/api.php/Vod/vod_play_history',
				method: 'POST',
				data: {
					token: '1CECE2221211DDCB613882C3311EC670',
					user_id: 84,
					type: 2
				},
				header: {
					'content-type': 'application/json;charset=UTF-8'
				},
				success: (res) => {
					console.log(res)
					this.videoList = res.data.data
					console.log(this.videoList)
				}
			})
		},
		methods: {
			goBack() {
				uni.navigateBack({
					delta: 1
				})
			}
		}
	}
</script>

<style>
	@import url("lookCache.css");
</style>
